#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<time.h>
#include<ctype.h>
#include<assert.h>
int main() {
    int y,m;
    int days;

    scanf("%d%d",&y,&m);
    if(y<=0||m<=0||m>12)
        days=-1;
    else switch(m){
        case 1:case 3:case 5:case 7:case 8:case 10:case 12:
            days=31;
            break;
        case 4:case 6:case 9:case 11:
            days=30;
            break;
        case 2:
            days=((y%4==0&&y%100==0)||y%400==0)?29:28
            break;
        default:
            days=-1;
            break;
    }

    if(days>0)
        printf("%d\n",days);
    else
        puts("Are you kidding...");



    return 0;
}
